import { BrandType, ProductChildren, NewType } from './category'

export interface GoodsType {
  brand: BrandType
  categories: ProductChildren[]
  collectCount: number
  commentCount: number
  desc: string
  details: GoodsDetail
  discount: number
  evaluationInfo: null | any
  hotByDay: NewType[]
  id: string
  inventory: number
  isCollect: null | any
  isPreSale: boolean
  mainPictures: string[]
  mainVideos: string[]
  name: string
  oldPrice: string
  price: string
  recommends: null | any
  salesCount: number
  similarProducts: NewType[]
  skus: SkuType[]
  specs: SpecsType[]
  spuCode: string
  userAddresses: null | any[]
  videoScale: number
}

export interface GoodsDetail {
  properties: PropertiesType[]
  pictures: string[]
}

export interface PropertiesType {
  name: string
  value: string
}

export interface SkuType {
  skuId: string
  specsText: string
  id: string
  inventory: number
  oldPrice: string
  price: string
  skuCode: string
  specs: SpecsType[]
}

export interface SpecsType {
  name: string
  valueName: string
  values: SpecsValuesType[]
}

export interface SpecsValuesType {
  disabled: boolean
  desc: string
  name: string
  picture: string
  selected: boolean
}

export interface ResultType {
  [key: string]: string
  provinceCode: string
  provinceName: string
  cityCode: string
  cityName: string
  countryCode: string
  countryName: string
  fullLocation: string
}

export interface CommentTags {
  type: string
  title: string
  tagCount: number
}

export interface CommentType {
  praisePercent: string
  salesCount: number
  hasPictureCount: number
  evaluateCount: number
  tags: CommentTags[]
}

export interface PageParams {
  page: number
  pageSize: number
  hasPicture: boolean
  tag: string
  sortField: string
}

export interface CommentMember {
  id: string
  nickname: string
  avatar: string
}

export interface SpecsItem {
  name: string
  nameValue: string
}

export interface CommentOrderInfo {
  quantity: number
  createTime: string
  specs: SpecsItem[]
}

export interface CommentItem {
  id: number
  content: string
  createTime: string
  member: CommentMember
  officialReply: string
  orderInfo: CommentOrderInfo
  pictures: string[]
  praiseCount: number
  score: number
  tags: string[]
}

export interface CommentList {
  page: number | string
  pageSize: number
  pages: number
  counts: number
  items: CommentItem[]
}
